package chapter18ShareLock;


/**
 * Created by LinGer on 2019/6/25
 */
public class ReentrantReadWriteLockTest {

    public static void main(String[] args) {
        MyCount myCount = new MyCount("4238920615242830", 10000);
        User user = new User("Tom", myCount);

        //启动“读取账户余额”线程和“设置账户金额”线程各3个
        for (int i = 1; i < 4; i++) {
            user.getCash();
            user.setCash(i * 1000);
        }
    }
}
